package com.leetcode;

import java.util.Arrays;
import java.util.Scanner;

public class 字符串排序 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNextLine()) {
            int num = Integer.parseInt(scanner.nextLine());
            String[] strings = new String[num];
            for (int i = 0; i < num; i++) {
                strings[i] = scanner.nextLine();
            }
            Arrays.sort(strings);
            Arrays.stream(strings).forEach(System.out::println);
        }
    }
}
